import Instance from "../../Core/Utils/Instance";
import * as pb from '../proto/protoCmd.js';

export default class ProtoBufManager {
    public static get ins(): ProtoBufManager {
        return Instance.get(ProtoBufManager);
    }
    /**
    * 获取 pb 属性
    * 通过 pb 属性来访问 protobuf 文件中的方法
    * 解决引用问题
    * @returns 返回 pb.protoCmd 类型的对象
    */
    public get common(): typeof pb.common {
        return pb[`default`].common as typeof pb.common;
    }
    public get http(): typeof pb.http {
        return pb[`default`].http as typeof pb.http;
    }
    public get lobby(): typeof pb.lobby {
        return pb[`default`].lobby as typeof pb.lobby;
    }
    public get game(): typeof pb.game {
        return pb[`default`].game as typeof pb.game;
    }
    public get connector(): typeof pb.connector {
        return pb[`default`].connector as typeof pb.connector;
    }
    public get support(): typeof pb.support {
        return pb[`default`].support as typeof pb.support;
    }
}